home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ Windows DOS Prompt.xpl < prev    next >
Text File  |  2003-07-28  |  3KB  |  83 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="1"
  3. "COUNT"="2"
  4. "UIPATH 1"="Appearance\System\Command Prompt"
  5. "UIPATH 2"="Program Options\Built in Windows Apps\Command Prompt"
  6. "NAME"="DOS Prompt Config"
  7. "OSVERSION"="10100"
  8. "VERSION"="1.02"
  9. "LANGUAGE"="VBScript"
  10. "TEXT 1"="DOS Prompt"
  11. "TEXT 2"="Windows Prompt"
  12. "DESCRIPTION 1"="To remind yourself that you are running a full screen DOS session from you can use this plug-in."
  13. "DESCRIPTION 2"="The second statement line is what you'll see as prompt during your DOS session (Windows DOS box), and you won't forget to go back to Windows when you're done working/playing in DOS."
  14. "DESCRIPTION 3"="Example DOS Prompt:" 
  15. "DESCRIPTION 4"="MS-DOS Mode!$_$P$G" 
  16. "DESCRIPTION 5"="Example Windows Prompt:"
  17. "DESCRIPTION 6"="Type EXIT & hit ENTER to return to Windows!$_$P$G"
  18. "AUTHOR"="Xteq Systems"
  19. "CONTACTURL"="http://www.xteq.com"
  20. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  21. "COMMENT 1"="Thanks to AXCEL216 for this tip."
  22.  
  23.  
  24. 'Declaration of some constants
  25. sF="C:\AUTOEXEC.BAT"
  26. sV1="SET PROMPT="
  27. sV2="SET WINPMT="
  28.  
  29. 'Called when the Plugin is started
  30. Sub Plugin_Initialize
  31.  Call FileSetAttribute(sF,"R-")
  32.  Call FileSetAttribute(sF,"H-")
  33.  
  34.  TxtOpen(sF)
  35.  
  36.  i=TxtFindLine(sV1,false) 'search for first prompt, ignoring case
  37.  if i>0 then
  38.     s=TxtGetLine(i)
  39.     'strip out the part after the "="
  40.     i=InStr(s,"=")      'find where "=" appears
  41.     s=Right(s,len(s)-i) 'extract the part after the "="
  42.     Call SetUIElement(1,s)    'finally, set inside UI
  43.    else
  44.     Call SetUIElement(1,"$p$g") ' use default if nothing is there
  45.  end if     
  46.  
  47.  i=TxtFindLine(sV2,false) 'search for second prompt, ignoring case
  48.  if i>0 then
  49.     s=TxtGetLine(i)
  50.     'strip out the part after the "="
  51.     i=InStr(s,"=")      'find where "=" appears
  52.     s=Right(s,len(s)-i) 'extract the part after the "="
  53.     Call SetUIElement(2,s)    'finally, set inside UI
  54.    else
  55.     Call SetUIElement(2,"$p$g") ' use default if nothing is there
  56.  end if     
  57.  
  58. End Sub
  59.  
  60. 'Called when the Plugin should validate the Data the user has entered
  61. Sub Plugin_CheckData(ElementIndex)
  62. End Sub
  63.  
  64. 'Called when the Plugin should apply the changes
  65. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  66.  s=GetUIElement(1)
  67.  i=TxtFindLine(sV1,false) 'search for second prompt, ignoring case
  68.  Call TxtSetLine(i,sV1 & s) 'write to file
  69.  
  70.  s=GetUIElement(2)
  71.  i=TxtFindLine(sV2,false) 'search for second prompt, ignoring case
  72.  Call TxtSetLine(i,sV2 & s) 'write to file
  73.  
  74.  Call FileBackup(sF) 'backup file
  75.  Call TxtSave() 'save file
  76. End Sub
  77.  
  78. 'Called when the Plugin is about to be removed from memory
  79. Sub Plugin_Terminate
  80.  Call FileSetAttribute(sF,"H+")
  81. End Sub
  82.  
  83.